<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/code.js"></script>
<link href="css/bootstrap.css"  rel="stylesheet" type="text/css">
<link href="css/bootstrapValidator.min.css"  rel="stylesheet" >
<script src="js/bootstrapValidator.js"></script>
</head>
<body>
<h1 align="center">办公自动化系统</h1>

	<br><br>
		<div class="col-md-12 text-right">
							
		<div class="modal-body" style="width: 600px; margin-left: 470px;">
					<div style="width: 480px;padding-left: 20px ; display: none; " align="center" id="imageselect">
						<img onclick="choose(this.src)" alt="" src="img/1.jpg" width="100px" height="100px">
						<img onclick="choose(this.src)" alt="" src="img/2.jpg" width="100px" height="100px">
						<img onclick="choose(this.src)" alt="" src="img/3.jpg" width="100px" height="100px">
						<img onclick="choose(this.src)" alt="" src="img/4.jpg" width="100px" height="100px">
						<img onclick="choose(this.src)" alt="" src="img/5.jpg" width="100px" height="100px">
						<img onclick="choose(this.src)" alt="" src="img/6.jpg" width="100px" height="100px">
						<img onclick="choose(this.src)" alt="" src="img/7.jpg" width="100px" height="100px">
						<img onclick="choose(this.src)" alt="" src="img/8.jpg" width="100px" height="100px">
						<br>
						<button class="btn btn-primary" id="closeselecticon">关闭</button>
					</div> 
					
                <form id="updateform" class="required-validate" action="${pageContext.request.contextPath }/register"
						method="post">
                <div align="left">
                    
                     <div class="form-group">
                        <label for="name" class="control-label">姓名:</label>
                        <input type="text" class="form-control" id="name" name="ygname">
                    </div>
                    <div class="form-group">
                        <label for="loginname" class="control-label">用户名:</label>
                        <input type="text" class="form-control" id="loginname" name="loginname">
                    </div>
                  
                    <div class="form-group">
                        <label for="password" class="control-label">密码:</label>
                        <input type="password" class="form-control" id="password" name="loginpw">
                    </div>
                    <div class="form-group">
                        <label for="okpassword" class="control-label">确认密码:</label>
                        <input type="password" class="form-control" id="okpassword" name="loginpwOK">
                    </div>
                    
                <!--     <div class="form-group">
                    	<label for="incode" class="control-label">验证码:<img id="img"  alt="" src="code.jsp" ><a>看不清</a></label>
                    	<input type="text" class="form-control" id="incode" name="incode">
                    </div>  -->
                    
                    
                    </div>
                </form>
                
                	<div  align="center">
                        <span id="returnMessage" class="glyphicon"> </span>
                        <button type="submit" class="btn btn-primary" name="submit"
						onclick="registersuccess()">注册</button>
						
						
						<a href="tologin"><i class="btn btn-primary">返回登录</i></a>
        
                    </div>
	
            </div>
  
</body>

<script language="JavaScript">
function registersuccess(){
	$.post("<%=basePath%>register.action",$("#updateform").serialize(),function(data){
		alert("注册成功！");
		location.href="tologin";
		
	});
	
	
	
}



</script>
</html>